<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Test: Source/Menu.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Test
   &#160;<span id="projectnumber">1.0.0.0</span>
   </div>
   <div id="projectbrief">A test</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_menu_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">Source/Menu.h</div>  </div>
</div>
<div class="contents">
<a href="_menu_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef MENU_H_</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define MENU_H_</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00005"></a>00005 
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;<a class="code" href="_window_8h.html">Window.h</a>&quot;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &quot;<a class="code" href="_menu_item_8h.html">MenuItem.h</a>&quot;</span>
<a name="l00008"></a>00008 
<a name="l00009"></a>00009 <span class="keyword">class </span><a class="code" href="class_scene.html">Scene</a>;
<a name="l00010"></a>00010 
<a name="l00014"></a><a class="code" href="_menu_8h.html#af4f8539d62b9d82947cd78d1cd7570e4">00014</a> <span class="keyword">typedef</span> void(<a class="code" href="class_scene.html">Scene</a>::*<a class="code" href="_menu_8h.html#af4f8539d62b9d82947cd78d1cd7570e4">SelectFunction</a>)(int);
<a name="l00015"></a>00015 
<a name="l00019"></a><a class="code" href="_menu_8h.html#a19bd77a09ed1460acde8799556fea96d">00019</a> <span class="preprocessor">#define SelectFunctionData(x) this, (SelectFunction)(&amp;x)</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00024"></a>00024 <span class="keyword">class </span><a class="code" href="class_menu.html">Menu</a> : <span class="keyword">public</span> <a class="code" href="class_window.html">Window</a> {
<a name="l00025"></a>00025         <span class="keyword">public</span>:
<a name="l00029"></a><a class="code" href="class_menu.html#a1de26a0176213eaf0df5afbc6096d7e9">00029</a>                 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="class_menu.html#a1de26a0176213eaf0df5afbc6096d7e9">ITEM_WIDTH</a> = <a class="code" href="class_window.html">Window</a><a class="code" href="class_window.html#acd23d331a69698c7a9b1d066aa05e1ea">::GRID_SIZE</a> * 16;
<a name="l00030"></a>00030 
<a name="l00034"></a><a class="code" href="class_menu.html#a87caab259b7ca18bb92cc05838299752">00034</a>                 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="class_menu.html#a87caab259b7ca18bb92cc05838299752">ITEM_HEIGHT</a> = <a class="code" href="class_window.html">Window</a><a class="code" href="class_window.html#acd23d331a69698c7a9b1d066aa05e1ea">::GRID_SIZE</a> * 3;
<a name="l00035"></a>00035 
<a name="l00041"></a>00041                 <span class="keyword">static</span> <a class="code" href="class_menu.html">Menu</a>* <a class="code" href="class_menu.html#a3993fe017f1aae678aebaacf76a8b41f">getTopMenu</a>();
<a name="l00042"></a>00042 
<a name="l00046"></a>00046                 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_menu.html#a79fe642511b8509d81d52e3243b65a01">pushMenuStack</a>(<a class="code" href="class_menu.html">Menu</a>* menu);
<a name="l00047"></a>00047 
<a name="l00051"></a>00051                 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_menu.html#ab8c493c0624601635166bbe264345c7d">popMenuStack</a>();
<a name="l00052"></a>00052 
<a name="l00056"></a>00056                 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_menu.html#a7401a39cefb6021d588e882231913f14">clearMenuStack</a>();
<a name="l00057"></a>00057 
<a name="l00061"></a>00061                 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_menu.html#ad4ddf45260f64f1f40cd8277d54c3405">drawMenuStack</a>();
<a name="l00062"></a>00062 
<a name="l00075"></a>00075                 <a class="code" href="class_menu.html#a7fae28e8b4ffb1da9ccf44aac24de4e0">Menu</a>(<span class="keywordtype">int</span> <a class="code" href="class_window.html#aa3be8f50b45a4f7b48ae66ae54885672">x</a>, <span class="keywordtype">int</span> <a class="code" href="class_window.html#a1da567c448323caf7873fe4f1d4cf4d6">y</a>, vector&lt;MenuItem&gt; items, <a class="code" href="class_scene.html">Scene</a>* handler, <a class="code" href="_menu_8h.html#af4f8539d62b9d82947cd78d1cd7570e4">SelectFunction</a> selectFunction, <span class="keywordtype">int</span> numColumns = 1, <span class="keywordtype">bool</span> canExit = <span class="keyword">true</span>);
<a name="l00076"></a>00076 
<a name="l00080"></a>00080                 <span class="keyword">virtual</span> <a class="code" href="class_menu.html#a831387f51358cfb88cd018e1777bc980">~Menu</a>();
<a name="l00081"></a>00081 
<a name="l00087"></a>00087                 <span class="keywordtype">int</span> <a class="code" href="class_menu.html#a88a60222cada559f0e2a897404b6eddf">getSelectedIndex</a>() <span class="keyword">const</span>;
<a name="l00088"></a>00088 
<a name="l00095"></a>00095                 <span class="keywordtype">void</span> <a class="code" href="class_menu.html#a19eec6215d2e6a854c96a338c238e696">setSelectedIndex</a>(<span class="keywordtype">int</span> newIndex);
<a name="l00096"></a>00096 
<a name="l00104"></a>00104                 <span class="keywordtype">void</span> <a class="code" href="class_menu.html#a174cfacd7767304830d7b7a9232f4df5">setItemEnabled</a>(<span class="keywordtype">int</span> index, <span class="keywordtype">bool</span> newEnabled);
<a name="l00105"></a>00105 
<a name="l00112"></a>00112                 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_menu.html#add49fdd2d51a0b8ea24c7b636ca3a9d6">handleEvent</a>(SDL_Event* event);
<a name="l00113"></a>00113 
<a name="l00114"></a>00114         <span class="keyword">private</span>:
<a name="l00118"></a>00118                 <span class="keyword">static</span> vector&lt;Menu*&gt; menuStack;
<a name="l00119"></a>00119 
<a name="l00123"></a>00123                 vector&lt;MenuItem&gt; items;
<a name="l00124"></a>00124 
<a name="l00128"></a>00128                 <a class="code" href="class_scene.html">Scene</a>* handler;
<a name="l00129"></a>00129 
<a name="l00133"></a>00133                 <a class="code" href="_menu_8h.html#af4f8539d62b9d82947cd78d1cd7570e4">SelectFunction</a> selectFunction;
<a name="l00134"></a>00134 
<a name="l00138"></a>00138                 <span class="keywordtype">int</span> numColumns;
<a name="l00139"></a>00139 
<a name="l00143"></a>00143                 <span class="keywordtype">bool</span> canExit;
<a name="l00144"></a>00144 
<a name="l00148"></a>00148                 <span class="keywordtype">int</span> selectedIndex;
<a name="l00149"></a>00149 
<a name="l00153"></a>00153                 <span class="keyword">virtual</span> <span class="keywordtype">void</span> drawContent();
<a name="l00154"></a>00154 };
<a name="l00155"></a>00155 
<a name="l00156"></a>00156 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_menu_8h.html">Menu.h</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">Generated on Wed Aug 17 2011 21:37:25 for Test by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5 </li>
   </ul>
 </div>


</body>
</html>
